package com.yoki.cloud.common.protocol.portal.exception;

import com.yoki.cloud.common.protocol.portal.exception.enums.PortalErrorStatusEnum;
import lombok.Getter;

/**
 * @author Sky$
 * @Description: TODO
 * @date 2017/10/29$ 16:22$
 */
public class PortalException extends Exception {

    @Getter
    protected int type;
    @Getter
    protected int errCode;

    public PortalException(int type, int errCode, String msg) {
        super(msg);
        this.type = type;
        this.errCode = errCode;
    }

    public PortalException(PortalErrorStatusEnum statusEnum) {
        super(statusEnum.getMsg() + " , type[" + statusEnum.getType() + "],errorCode[" + statusEnum.getErrCode() + "]");
        this.type = statusEnum.getType();
        this.errCode = statusEnum.getErrCode();
    }

}
